const {override, overrideDevServer, addBabelPlugin}=require('customize-cra'); //不能用import导入，会报错；
const addCustomize = () => config => {
    //do stuff with the webpack config...
    console.log(config);
    return config;
}
//配置代理；
const addProxy = () => (configFunction) => {
    configFunction.proxy = {
        '/v2ex/': {
            target: 'https://www.v2ex.com',
            changeOrigin: true,
            pathRewrite: { '^/v2ex': '/' },
        },
    };
    return configFunction;
}
module.exports={
    webpack:override(
        addBabelPlugin(['@babel/plugin-proposal-decorators', { "legacy": true }]),
        addCustomize()
    ),
    devServer:overrideDevServer(
        addProxy()
    )
}